package com.formation.dao.impl;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.formation.dao.UserJpaDAO;
import com.formation.entities.User;

@Repository
public class UserJpaDAOImpl implements UserJpaDAO {
	
	@PersistenceContext(unitName="formationPU")
	private EntityManager em;

	
	@Transactional
	public User createUser(User user) {
		
		em.persist(user);
		
		return user;
	}


	public void setEm(EntityManager em) {
		this.em = em;
	}
	

}
